<%@ page language="java" pageEncoding="UTF-8"%>

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>

<logic:notPresent name="userName" scope="session">
	<logic:redirect forward="login"></logic:redirect>
</logic:notPresent>

<logic:notEqual name="userName" scope="session" value="admin">
	<logic:redirect forward="login"></logic:redirect>
</logic:notEqual>

<logic:present name="info" scope="request">
	<font color="red"><bean:write name="info" scope="request" /> </font>
</logic:present>
<html:form action="/sendMessageSubmit" focus="username">
	<table>
		<tr>
			<td>
				发送给 :
			</td>
			<td>
				<html:text property="username" />
				<html:errors property="username" />
			</td>
		</tr>
		<tr>
			<td>
				内容 :
			</td>
			<td rowspan="5">
				<html:textarea property="content" cols="30" rows="5" />
				<html:errors property="content" />
			</td>
		</tr>
		<tr>
			<td></td>
		</tr>
		<tr>
			<td></td>
		</tr>
		<tr>
			<td></td>
		</tr>
		<tr>
			<td></td>
		</tr>
		<tr>
			<td>
				<html:submit value="发送" />
			</td>
			<td></td>
		</tr>
	</table>
</html:form>
